package org.datacoder

import grails.util.Environment
import org.hibernate.SessionFactory
import org.datacoder.geocoding.jurisdiction.*

/**
 * A class for loading geographic data into the database.
 */
public class SampleData{

    public static final List<String> FIRST_STATE_IDS = [
        "AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY"
    ]
    public static final List<String> SECOND_STATE_IDS = [
        "LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND"
    ]
    public static final List<String> THIRD_STATE_IDS = [
        "OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"
    ]
    public static final List<String> ALL_STATE_IDS = FIRST_STATE_IDS + SECOND_STATE_IDS + THIRD_STATE_IDS

    def allService

    public SampleData(AllService allService){
        this.allService = allService
    }

    public void createSampleData(List<String> stateIds){
        println "***********************"
        println "*--BEGIN CREATE DATA--*"
        println "***********************"
        JurisdictionLocator jl = new JurisdictionLocator(allService)
        jl.createJurisdictionData(stateIds)
        println "***********************"
        println "*---END CREATE DATA---*"
        println "***********************"
    }

}
